{% extends 'activity/activity-form-layout.html.twig' %}

{% do script(['libs/es-ckeditor/ckeditor.js', 'app/js/activity-manage/text/index.js'], 300) %}

{% block activity_content %}
  <div class="form-group">

    <div class="col-sm-2 control-label">
      <label for="text-content-field" class="control-label-required">{{ 'course.plan_task.activity_manage.text'|trans }}</label>
    </div>
    <div class="col-sm-10">
      {% if draft %}
        <a id="see-draft-btn" class="link-primary text-12 js-continue-edit" data-content="{{ draft.content }}">
          {{'course.plan_task.activity_manage.text_tips'|trans}}
        </a>
      {% endif %}
      <textarea class="form-control type-hidden js-text" id="text-content-field" name="content"
        data-image-upload-url="{{ path('editor_upload', {token:upload_token('course')}) }}"
        data-flash-upload-url="{{ path('editor_upload', {token:upload_token('course', 'flash')}) }}"
        data-image-download-url="{{ path('editor_download', {token:upload_token('course')}) }}"
        data-save-draft-url="{{ path('course_text_activity_auto_save', {courseId: courseId, activityId: activity.id|default(0)}) }}"
      >
        {{ activity.content|default('') }}
      </textarea>
    </div>
  </div>
{% endblock %}

{% block activity_finish %}
  <div class=" form-group">
    <div class="col-sm-2 control-label">
      <label for="condition-select">{{ 'course.plan_task.activity_manage.finished_condition'|trans }}</label>
    </div>
    <div class="col-sm-4 form-control-static">
      {{'course.plan_task.activity_manage.doc.watch_time'|trans}}
      <input type="hidden" id="condition-select" name="finishType">
      {#<select class="form-control" id="condition-select" name="finishType">
        <option value="time" {% if text.finishType|default('end') == 'time' %}selected{% endif %}>观看时长</option>
      </select>#}
    </div>
  </div>
  <div class=" form-group" id="condition-group">
    <div class="col-sm-2 control-label">
      <label for="finishDetail">{{ 'course.plan_task.activity_manage.doc.watch_time_at_least'|trans }}</label>
    </div>
    <div class="col-sm-4">
      <input id="finishDetail" class="form-control" type="text" name="finishDetail" value="{{ text.finishDetail|default(1) }}">
    </div>
    <div class="col-sm-4">
      <p class="form-control-static">{{'site.date.minute'|trans}}</p>
    </div>
  </div>
{% endblock %}
